package com.u1zz.zeus.module.iot.controller.admin.device.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
import com.u1zz.zeus.framework.excel.core.annotations.DictFormat;
import com.u1zz.zeus.framework.excel.core.convert.DictConvert;

@Schema(description = "管理后台 - 设备 Response VO")
@Data
@ExcelIgnoreUnannotated
public class DeviceRespVO {

    @Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "8100")
    @ExcelProperty("id")
    private Long id;

    @Schema(description = "设备标识", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("设备标识")
    private String deviceKey;

    @Schema(description = "设备名称", example = "张三")
    @ExcelProperty("设备名称")
    private String deviceName;

    @Schema(description = "所属产品", requiredMode = Schema.RequiredMode.REQUIRED, example = "4751")
    @ExcelProperty("所属产品")
    private Long productId;

    @Schema(description = "描述", example = "你猜")
    @ExcelProperty("描述")
    private String description;

    @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "UNACTIVE")
    @ExcelProperty(value = "状态", converter = DictConvert.class)
    @DictFormat("iot_device_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String status;

    @Schema(description = "激活时间")
    @ExcelProperty("激活时间")
    private LocalDateTime activeTime;

    @Schema(description = "最后上线时间")
    @ExcelProperty("最后上线时间")
    private LocalDateTime lastOnlineTime;

    @Schema(description = "设备密钥", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("设备密钥")
    private String deviceSecret;

    @Schema(description = "固件版本号")
    @ExcelProperty("固件版本号")
    private String version;

}